load("@npm//:defs.bzl", "npm_link_all_packages")
load(
    "//src/material-experimental:config.bzl",
    "MATERIAL_EXPERIMENTAL_SCSS_LIBS",
    "MATERIAL_EXPERIMENTAL_TARGETS",
    "MATERIAL_EXPERIMENTAL_TESTING_TARGETS",
)
load("//tools:defaults.bzl", "ng_package", "sass_library", "ts_project")

package(default_visibility = ["//visibility:public"])

npm_link_all_packages()

ts_project(
    name = "material-experimental",
    srcs = glob(
        ["*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    deps = ["//:node_modules/@angular/core"],
)

sass_library(
    name = "theming_scss_lib",
    srcs = MATERIAL_EXPERIMENTAL_SCSS_LIBS,
)

sass_library(
    name = "sass_lib",
    srcs = ["_index.scss"],
    deps = [
        ":theming_scss_lib",
    ],
)

ng_package(
    name = "npm_package",
    package_name = "@angular/material-experimental",
    srcs = [
        "package.json",
        ":sass_lib",
    ],
    package_deps = [
        ":node_modules/@angular/material",
        ":node_modules/@angular/cdk",
        ":node_modules/@angular/cdk-experimental",
    ],
    tags = ["release-package"],
    visibility = [
        "//:__pkg__",
        "//goldens:__pkg__",
        "//integration:__subpackages__",
    ],
    deps = MATERIAL_EXPERIMENTAL_TARGETS + MATERIAL_EXPERIMENTAL_TESTING_TARGETS,
)
